home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / newmat03.lha / newmat03 / boolean.hxx next >
Text File  |  1993-08-08  |  438b  |  22 lines

  1. //$$ boolean.hxx                     Boolean class
  2.  
  3. #ifndef BOOL_LIB
  4. #define BOOL_LIB 0
  5.  
  6. class BOOL
  7. {
  8.    int value;
  9. public:
  10.    BOOL(int b) { value = b ? 1 : 0; }
  11.    BOOL(void* b) { value = b ? 1 : 0; }
  12.    BOOL() {}
  13.    operator int() const { return value; }
  14.    BOOL operator&&(const BOOL& b) const { return value && b.value; }
  15.    BOOL operator||(const BOOL& b) const { return value || b.value; }
  16. };
  17.  
  18. #define FALSE 0
  19. #define TRUE 1
  20.  
  21. #endif
  22.